﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data;
using System.Data.SqlClient;

namespace Html1
{
    /// <summary>
    /// Summary description for Postion
    /// </summary>
    public class Postion : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
           
            string cnnString = "Data Source=shni548;DataBase=PIPC_Production;UID=sa;PWD=password_1;Connection Reset=FALSE;Connect Timeout=120";
            SqlConnection cnn = new SqlConnection(cnnString);
            
            string queryString = "select GroupInfokey  from Position";
            SqlCommand command = new SqlCommand(queryString, cnn);
            cnn.Open();
            SqlDataReader reader = command.ExecuteReader();
            while (reader.Read())
            {
                context.Response.Write(reader[0]);      
            }
            //context.Response.Redirect("http://www.sohu.com");
            reader.Close();
            cnn.Close();
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}